import package1

a = 2
print(a)
print(package1.a)

# 从包中导入模块module1
from package1 import module1
# 从包中导入模块module1 并取别名m1
from package1 import module1 as m1
# 从模块中直接导入方法或变量
from package1.module1 import i, func1
import package1.module1 as m11

print(module1.i)
module1.func1()

print(m1.i)
m1.func1()

print(i)
func1()

print(m11.i)
m11.func1()

import sys

print(sys.modules)
# 导包时搜索的路径
print(sys.path)

